Devices that support WIFI Direct (wireless fidelity direct, a wireless fidelity direct technology) can implement wireless connection to each other and network establishing without requiring an access point or a router. In a network, one device is used as a group server, and other devices are used as group clients. The group server is a master node in the network. When the group clients exchange data, one group client first sends the data to the group server, and the group server then sends the data to another group client. Therefore, a data exchange capability of the device used as the group server is essentially important.
In the prior art, when a network is established, devices compare their group server intention values. A device whose group server intention value is relatively large becomes a group server, and a device whose group server intention value is relatively small becomes a group client. However, the group server intention value is generally a default value, and a device that is determined as the group server according to the group server intention value is not necessarily a device having the strongest data exchange capability among devices that establish the network. In addition, after network establishing is complete, if another device needs to be added to the network, the another device can become only a group client of the network regardless of a data exchange capability of the another device. That is, even if the data exchange capability of the another device is relatively strong, the another device cannot become the group server of the network. Therefore, when an amount of data exchanged in the network is relatively large, and if a data exchange capability of the device used as the group server is relatively weak, a data exchange capability of an entire network is still restricted by the relatively weak data exchange capability of the group server even if the network includes a device having a stronger data exchange capability, and therefore, the device having a stronger data exchange capability is not fully used.
The present invention seeks to resolve the foregoing problem.